UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NOqnOLsbBfQU/65ZsIAIgbZmT4GtsiXAktVAvFXPrl0='
WHERE
key_id = '3993dfc244b006ac985bf2a8130d727279b26541504151d6a285cf3669255a72'
AND (
token = 'NOqnOLsbBfQU/65ZsIAIgbZmT4GtsiXAktVAvFXPrl0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)