UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm513Z++64ZJ59T9neB3n6WAbowFyOKYg0JfKiqk6tqg=' 
WHERE 
  key_id = 'ba70e3a6c0f58278aeea8cc25923264d04e1e03b09196f9b7d310809bfc1d45d' 
  AND (
    token = 'm513Z++64ZJ59T9neB3n6WAbowFyOKYg0JfKiqk6tqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036