UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '52j5nbKxQLNScNr/C48kCRhDfyeS6uMQat/UtpjD/N8='
WHERE
key_id = 'a8840451edbaa2cbc7fcfa9a003988e59a6fad8fcdf825c2d04db764c25af37c'
AND (
token = '52j5nbKxQLNScNr/C48kCRhDfyeS6uMQat/UtpjD/N8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)