UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MDhLHVoc9WpltBrO3yaWhcz6PDkhUW3g5GcqV6wO7+Y=' 
WHERE 
  key_id = 'db735804cd8de7b7ea858d98bc1bea06bc8660cbb08a597ba515b4020fe7ed2f' 
  AND (
    token = 'MDhLHVoc9WpltBrO3yaWhcz6PDkhUW3g5GcqV6wO7+Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062