UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lXE71Q2FtzKR8kWw1qIHogsxylZ2TOkzLKm3q252740=' 
WHERE 
  key_id = 'ce3add18273cbca3609eea67de7adbd09d06b7aeeaade8f5139be00418062db9' 
  AND (
    token = 'lXE71Q2FtzKR8kWw1qIHogsxylZ2TOkzLKm3q252740=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035