UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3v+x+lIIeQM+TLy9IyVuRvFlmkKT14lSRz02EDpHwRE=' 
WHERE 
  key_id = 'e1f2189f20a9c7bd66be442fcf8261e7ad2081ad255f051a11cb895197ea9258' 
  AND (
    token = '3v+x+lIIeQM+TLy9IyVuRvFlmkKT14lSRz02EDpHwRE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039