UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g20tp3raQVx91HfhksdVZW9Uk8jMLtkjgI8IobIa1SQ='
WHERE
key_id = '8c9ac3d8505725181954ec40233783e4be578067d3edb8a7eca589ebdfdac1ae'
AND (
token = 'g20tp3raQVx91HfhksdVZW9Uk8jMLtkjgI8IobIa1SQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)