UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FFqiKGJsUjwgAmUc4E56dfqcPAYYHxvGemz/KFr6K9s='
WHERE
key_id = 'da451170db40c18f3f5fce947c238dc65e224374abf892cff035ac0ed6db8f32'
AND (
token = 'FFqiKGJsUjwgAmUc4E56dfqcPAYYHxvGemz/KFr6K9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)