UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EBrNNg6PrlYe1hT7H5yf2AaSmZqJJkt+4SIymhhlNKA='
WHERE
key_id = '7c8b45d446f170b1a0391acb0caf4bdc7ab1b171e28fec84bd8ecf018af65801'
AND (
token = 'EBrNNg6PrlYe1hT7H5yf2AaSmZqJJkt+4SIymhhlNKA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)