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

Query time 0.00037