UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Hi1lzu60nk0JlIaWZeRnOG1Mt+VT1S4nGDaZaun1hw='
WHERE
key_id = '3bf20f18fc69f0ce19c2415b18a0bcbea18b8182bfbe90e118da8ab46da7c5cc'
AND (
token = '/Hi1lzu60nk0JlIaWZeRnOG1Mt+VT1S4nGDaZaun1hw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)