UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GKB07j5nM4vIYwbQ+hXFR0fqH3rfbmjXIRnqbmlv8kg=' 
WHERE 
  key_id = 'e35078746340dac1eab46e313db8031bac7a3302307476e6197264430784ba62' 
  AND (
    token = 'GKB07j5nM4vIYwbQ+hXFR0fqH3rfbmjXIRnqbmlv8kg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064