UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nuphtkb1zAu5cQ07UD69rAgwZm2RMP42hETLTJW/6Pg=' 
WHERE 
  key_id = 'b0b5b3af2731e5e642681151a863c549f17dd890330b61e914e55d439b87281f' 
  AND (
    token = 'nuphtkb1zAu5cQ07UD69rAgwZm2RMP42hETLTJW/6Pg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037