UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VgMz/37nZozEsl1/2si6zKsGne0jHq3M+lkhbOAFmAQ=' 
WHERE 
  key_id = '02791792b5dc629cfd3c1dea7d443b2412fb42c0ae60cbf3aedc8e958e825b38' 
  AND (
    token = 'VgMz/37nZozEsl1/2si6zKsGne0jHq3M+lkhbOAFmAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036