UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3vbv9IQiaAFu+WI/p4oFp2ETaojMp3t0ZtAOPOgQwec=' 
WHERE 
  key_id = '99e74e143980143cf8ef434245eb4c3f9f60277b76eb93d05b1e1fad82c2a2d9' 
  AND (
    token = '3vbv9IQiaAFu+WI/p4oFp2ETaojMp3t0ZtAOPOgQwec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047