UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5pbk7m/dtkghVKywWezQS7+xFzj6zuIZPTJ1gTeWhPI='
WHERE
key_id = '8f57fb3cacce085a6367273f31c60de931c48eaf0b8cefec37c138b9e1c2bf37'
AND (
token = '5pbk7m/dtkghVKywWezQS7+xFzj6zuIZPTJ1gTeWhPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)