UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PHa1Ht9KkArCvFXO8emZ2z3KUW4krY7htC2hLM6yIjE='
WHERE
key_id = '3eba29b940de31533772db01c87e8b0e1e62d04f9cd4006073828306914510d6'
AND (
token = 'PHa1Ht9KkArCvFXO8emZ2z3KUW4krY7htC2hLM6yIjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)