UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's/KlRv6J/RuDty/5WINPUFjWlVLRUM6DcDz+fzlNvus='
WHERE
key_id = 'cbea9b7e26cec42229ab368f3f657aa0ec05efb496e28dd501dccd4eab28cc27'
AND (
token = 's/KlRv6J/RuDty/5WINPUFjWlVLRUM6DcDz+fzlNvus='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)