UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6veWM/uZnVErTBvV0Zz5SNwi5yrvnGQZbdh6rFOTJvo='
WHERE
key_id = '347a664e8066b915327a8aafb45483452eaccdb3e290ef9a3b90996340eed3c9'
AND (
token = '6veWM/uZnVErTBvV0Zz5SNwi5yrvnGQZbdh6rFOTJvo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)