UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J6Ey2XKef+M6E9eTBBs71mmanL8IjANtDv1TmaFbQPg='
WHERE
key_id = '6c2f24cdffaaa9eef3dbeb534cf3ea3c6cb4dc21d8392c41e518f63105e89321'
AND (
token = 'J6Ey2XKef+M6E9eTBBs71mmanL8IjANtDv1TmaFbQPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)