UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3v3lSK0TzJHcNcNO51GeyniXUl4icIffWV7usyIaBgo=' 
WHERE 
  key_id = 'c08f0a54b5b96f94021914139d0be3b493eafb14505c003996cafae7e058e94b' 
  AND (
    token = '3v3lSK0TzJHcNcNO51GeyniXUl4icIffWV7usyIaBgo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028