UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oOWuOqiuMyoUedfRcCPcxfhJl3N/l2UXpWmv3MLb5rg=' 
WHERE 
  key_id = 'c4aaac4711f33a677715422910fe461d898f83404ef7e2a9740acf181f3e6630' 
  AND (
    token = 'oOWuOqiuMyoUedfRcCPcxfhJl3N/l2UXpWmv3MLb5rg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021