UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y+unKCouQX/zYvOZWn1wHzFSsVECa3fjimHTjZP3qJM='
WHERE
key_id = '451ab53b02a3a812d90e03157431946e67c763eaab542f3b5b77b4a531566039'
AND (
token = 'Y+unKCouQX/zYvOZWn1wHzFSsVECa3fjimHTjZP3qJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)