UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SYZaudGpQaBdgVqZOw+xIDrJa3DAtV4/1JqNJHfJ92o='
WHERE
key_id = '12ea82b18ba2b688477765d8769aab8a3066518df14899c021475614e997c6cb'
AND (
token = 'SYZaudGpQaBdgVqZOw+xIDrJa3DAtV4/1JqNJHfJ92o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)