UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CIxkMA7q77XOOIfzL+dN3nAsT9GZWFjBQgLEaiUosWg='
WHERE
key_id = '33683013aab0bee5ba07a0b8a027851d9aba3d981efd96d58b1a0c01930e8d56'
AND (
token = 'CIxkMA7q77XOOIfzL+dN3nAsT9GZWFjBQgLEaiUosWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)