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