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