UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '57d5tZMluxK4SPbr/oNYY3T1ogU7oGxL90qf5Dbf5fw=' 
WHERE 
  key_id = 'b0f613f75546ad29c96a21cbb528bda021521587e740b0a6560ab6065a4ee472' 
  AND (
    token = '57d5tZMluxK4SPbr/oNYY3T1ogU7oGxL90qf5Dbf5fw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036