UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'exqe7A/lHJCm+BAV1HX5YPAUwYf2DLIWZhIwiCDcbdI='
WHERE
key_id = '24a63f0ec41d5543caca41aa3d9f3ffe433058ca4ce3182f7357f69052274ed9'
AND (
token = 'exqe7A/lHJCm+BAV1HX5YPAUwYf2DLIWZhIwiCDcbdI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)