UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wUoAlxkWJhpVekhTrPG6KuZmGEXI5i2emqgn1G1IlJU='
WHERE
key_id = 'ec157cb00f63c134cb328fb8766eb181509c57275e74717d29ade91398240ea5'
AND (
token = 'wUoAlxkWJhpVekhTrPG6KuZmGEXI5i2emqgn1G1IlJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)