UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IpFyFW07kUDlnyC6lRH6ihSwimkoI7ggmh9nkEmirLc='
WHERE
key_id = '45695002d9ff933e65b848f6113f47c556e97f55171d0e5ad7df1aaab1bd698e'
AND (
token = 'IpFyFW07kUDlnyC6lRH6ihSwimkoI7ggmh9nkEmirLc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)