UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yVzB6z419uFzgbI5DQ2SsIiuOQo/GYkKz6IHLyR2Za8='
WHERE
key_id = 'e500c9754174861bc196634700384e25fd6da404e432c0552cce2a3b5a4c34d4'
AND (
token = 'yVzB6z419uFzgbI5DQ2SsIiuOQo/GYkKz6IHLyR2Za8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)