UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zpFdZ+Oox8rYbJ3HCzO8aEH3sQvikDNGsZ00dVhX8fc=' 
WHERE 
  key_id = '7dd3bfb0cf8ad97271e8e58bd0e49fbf06ff37a351f79d81922af1eff341c1bf' 
  AND (
    token = 'zpFdZ+Oox8rYbJ3HCzO8aEH3sQvikDNGsZ00dVhX8fc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038