UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mNQmMyufrgSwRLV12kdBmRXdt/PVx/5U1ziCM/8n9KI='
WHERE
key_id = '21efb8bbe215fc140e7b0fb7b50741ad855f8e727b666694f12fc670716bba4d'
AND (
token = 'mNQmMyufrgSwRLV12kdBmRXdt/PVx/5U1ziCM/8n9KI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)