UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FW0k9zL0M3n27/hj5u3w081KjMshvddyMVbXbMoW20M='
WHERE
key_id = '969e619226c72425b73eb8cd727a7d9bef550d13d26868a4f3bf61b1aeea525c'
AND (
token = 'FW0k9zL0M3n27/hj5u3w081KjMshvddyMVbXbMoW20M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)