UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MLw/aGsXf8zeF4vvz5CJFh8TWQFfP6GGA/dPclHm4Hg='
WHERE
key_id = 'e55158a3e383de5e330d0b9320db90151753db13203ac933c3ecff7f0705ac17'
AND (
token = 'MLw/aGsXf8zeF4vvz5CJFh8TWQFfP6GGA/dPclHm4Hg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)